#ifndef PGLPOOLS_H
#define PGLPOOLS_H

#pragma once

#include <numeric>
#include <functional>

#include <pgl/core/PGLObjectPool.h>
#include <pgl/core/PGLObject.h>
#include <pgl/core/PGLBrush.h>
#include <pgl/core/PGLData.h>


template <typename T>
class TPGLPoolSingleton
{
public:
	static boost::static_ptr<T> Find( long lID )
	{
		return boost::static_dynamic_cast<T, CPGLNodePoolSingleton::NodeValue>( CPGLNodePoolSingleton::FindNode( lID ) );
	}
};

typedef TPGLPoolSingleton<CPGLBrush> CPGLBrushPoolSingleton;
class PGLCORE_EXT_CLASS CPGLObjectPoolSingleton : public TPGLPoolSingleton<CPGLObject>
{
public:
	static CPGLObjectStPtr FindObject( long lID )	
	{ 
		return Find(lID);
	};
};

typedef TPGLPoolSingleton<CPGLRegion> CPGLRegionPoolSingleton;
typedef TPGLPoolSingleton<CPGLData> CPGLDataPoolSingleton;

#endif